/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SComplaintConverter.java
 * Created：		2016年8月21日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.common;

import org.springframework.core.convert.converter.Converter;

import com.thor.commons.entity.UCN;
import com.thor.palmmall.rest.common.ASignInInfo;
import com.thor.palmmall.spi.basic.SSignInInfo;

/**
 * @author wolv
 *
 */
public class SSignInInfoConverter implements Converter<ASignInInfo, SSignInInfo> {

	public static SSignInInfoConverter getInstance() {
		if (instance == null)
			instance = new SSignInInfoConverter();
		return instance;
	}

	private static SSignInInfoConverter instance;

	private SSignInInfoConverter() {
	}

	@Override
	public SSignInInfo convert(ASignInInfo source) {
		if (source == null)
			return null;

		SSignInInfo target = new SSignInInfo();
		target.setBillUuid(source.getBillUuid());
		target.setOperatorUser(UCN.newInstance(source.getOperatorUser()));
		target.setTaskUuid(source.getTaskUuid());
		target.setUser(UCN.newInstance(source.getUser()));

		return target;
	}
}
